/***************************************************************************
   Filename:    Brick.h
   Authors:     Josh Partridge and Joe Flowers
   Description: contains the brick class
****************************************************************************/

#ifndef BRICK_H
#define BRICK_H

#include "Brush.h"
#include "boxgen.h"
using namespace std;

const int default_h = 1;
const int default_w = 4;

class Brick
{
    //we'll probably write child classes of brick, so this stuff should be available
    protected:
        //boundaries of the brick
        RECT bounds;
        //current health
        int health;
        ink color;

	public:
        /************************************************************************************
         Name:               Brick - constructors
         Description:        initialize various attributes of Brick
         Input:
                       htlh: int representing health of brick
                          x: int representing x position of brick
                          y: int representing y position of brick
                          w: int representing width of brick
                          h: int representing height of brick
                          c: ink representing color of the brick
        *************************************************************************************/
        //default everything
        Brick();
        //specify only health
        Brick(int hlth);
        //specify only x,y coords
        Brick(int x, int y);
        //specify only x,y coords and color
        Brick(int x, int y, ink c);
        //specify only health and x,y coords
        Brick(int hlth, int x, int y);
        //specify health, x,y coords and color
        Brick(int hlth, int x, int y, ink c);
        //specify only bounds
        Brick(int x, int y, int w, int h);
        //specify everything but color
        Brick(int hlth, int x, int y, int w, int h);
        //specify everything
        Brick(int hlth, int x, int y, int w, int h, ink c);

        /************************************************************************************
         Name:               setBounds
         Description:        setter for bounds (RECT attributes)
         Input:
                          x: int representing x position of brick
                          y: int representing y position of brick
                          w: int representing width of brick
                          h: int representing height of brick
        *************************************************************************************/
        void setBounds(int x, int y, int w, int h);

        /************************************************************************************
         Name:               getBounds
         Description:        getter for bounds RECT
         Output:
                     return: RECT (copy of bounds)
        *************************************************************************************/
        RECT getBounds();

        /************************************************************************************
         Name:               setHealth
         Description:        sets health of brick
         Input:
                          h: int representing health of brick
        *************************************************************************************/
        void setHealth(int h);

        /************************************************************************************
         Name:               takeDamage
         Description:        modifies brick when it takes damage, including erasing it
         Input:
                    damage: int representing amount to decrease health
                     score: reference to game's score attribute (unsigned int)
        *************************************************************************************/
        void takeDamage(int damage, unsigned int &score);

        /************************************************************************************
         Name:               isAlive
         Description:        reports whether health > 0
         Output:
                     return: bool representing whether health > 0
        *************************************************************************************/
        bool isAlive();

        /************************************************************************************
         Name:               setColor
         Description:        sets brick's display color
         Input:
                          c: new color (ink)
        *************************************************************************************/
        void setColor(ink c);

        /************************************************************************************
         Name:               display
         Description:        brick draws itself to the screen
         Input:
                      brush: reference to game's Brush
        *************************************************************************************/
        void display(Brush& brush);
};

#endif
